function addBigInt(a, b) {
    let maxLen = Math.max(a.length, b.length);
    // 用0补齐长度
    a = a.padStart(maxLen, 0);
    b = b.padStart(maxLen, 0);
    // 定义加法过程中需要用到的变量
    let t = 0, f = 0;
    let sum = '';

    for (let i = maxLen - 1; i >= 0; i--) {
        t = parseInt(a[i]) + parseInt(b[i]) + f;
        f = Math.floor(t / 10);
        sum = t % 10 + sum;
    };

    if (f === 1) {
        sum = '1' + sum;
    };

    return sum;
};



// test
let a = '9007199254740991';
let b = '1234567899999999999';

